package com.example.mymvp.Presenter;


import com.example.mymvp.Model.MyModelIml;
import com.example.mymvp.View.MyView;

public class MyPresenterIml implements MyPresenter {
    private MyView myView;//持有 View借口层的对象
    private MyModelIml myModelIml;

    //当Activity调用MyPresenterIml
    public MyPresenterIml(MyView myView) {
        this.myView = myView;
    }

    @Override
    public void clear() {
        myView.onClearText();
    }



    @Override
    public void doLongin(String name, String passwd) {
        myModelIml = new MyModelIml(name, passwd);
        Boolean rea = false;
        int code = myModelIml.checkUserValidity();
        if (code == 1) {
            rea = true;
        }
        myView.onLoginReuslt(rea, code);

    }
}
